#ifndef PAINTSYSTEM_H
#define PAINTSYSTEM_H

#ifndef CARGO_H
#endif

#ifndef SHAPE_CARGO_H
#include "../Cargo/Shape.h"
#endif

#include <QMap>
#include <QPixmap>
#include <QGraphicsScene>

///  存有 hashid->qprixmap的映射
///  所有的cargo: hashid -> cargo_pixmap_map
class PaintSystem
{
    QGraphicsScene * scene;
    // QMap<std::string,QPixmap> cargo_pixmap_map;
    void generateNewShape(std::string &);
public:
    PaintSystem(QGraphicsScene * scene);
    inline QGraphicsScene * getscene()const {return scene;} ;
    QPixmap generateQPixmapWithString(std::string &);
    void drawColorCargo(int x, int y,gate::GateDirection g, char _id, Cargo * cargo);
    void drawShapeCargo(int x, int y,gate::GateDirection g,  ShapeCargo * shape); // 根据shape 和 位置绘制



};

#endif // PAINTSYSTEM_H
